package com.sen.app.timemail.utils.logs;

import java.io.Serializable;

import org.apache.log4j.Logger;

/**
 * app logger
 * 
 * @author sen
 */
public class AppLogger implements Serializable{
	
	private static final long serialVersionUID = 8804583456343791346L;
	
	private transient Logger logger = null;
	
	public AppLogger(String name){
		logger = Logger.getLogger(name);
	}
			
	public void info(String info){
		if (logger.isInfoEnabled()) {
			logger.info(info);
		}
	}

	public void debug(String info){
		if(logger.isDebugEnabled()) {
			logger.debug(info);
		}
	}
	
	public void warn(String info){
		logger.warn(info);
	}
	
	public void error(String info){
		logger.error(info);
	}
	
	public void error(String info, Throwable e) {
		logger.error(info, e);
	}
	
	public boolean isInfoEnabled(){
		return logger.isInfoEnabled();
	}
	
	public boolean isDebugEnabled(){
		return logger.isDebugEnabled();
	}	

	public Logger getLogger() {
		return logger;
	}
}
